package com.huike.business.domain.mapper;

import com.huike.business.domain.TbBusiness;
import com.huike.business.domain.TbBusinessTrackRecord;
import com.huike.business.domain.vo.BusinessTrackVo;
import com.huike.common.core.domain.entity.SysUser;
import com.huike.common.core.page.BusinessPageQueryDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

@Mapper
public interface TbBusinessMapper {

    List<TbBusiness> selectUserList(TbBusiness user);

    List<TbBusiness> selectListPool(TbBusiness user);

    void deletedList(@Param("List") List<Long> ids);

    TbBusiness findDetalisById(Long id);

    /**
     * 新增商机
     * @param tbBusiness
     */
    void add(@Param("tbBusiness") TbBusiness tbBusiness);

    /**
     *修改商机
     * @param tbBusiness
     */
    void update(TbBusiness tbBusiness);

    /**
     * 根据id查找商机
     * @return
     */
    @Select("select * from tb_business where id = #{id}")
    TbBusiness findById(Long id);

    public void updateBusinessEndTimeById(@Param("id")Long id, @Param("endTime") Date endTime);

    void followInsert(BusinessTrackVo businessTrackVo);



    /**
     * 获取商机跟进记录详细信息
     * @param businessTrackVo
     * @return
     */
    TbBusinessTrackRecord detailed(BusinessTrackVo businessTrackVo);

    /**
     * 查询商机跟进记录列表
     * @param id
     * @return
     */
    List followSelect(Long id);
}
